import request from '@/utils/request'

// 获取spu信息列表
export const getSpuList = (page, limit, category3Id) =>
  request({
    url: `/admin/product/${page}/${limit}`,
    method: 'get',
    params: { category3Id }
  })

// 添加,修改spu信息
export const saveSpuInfo = (data) =>
  request({
    url: data.id
      ? '/admin/product/updateSpuInfo'
      : '/admin/product/saveSpuInfo',
    method: 'post',
    data
  })

// 获取品牌列表
export const getTradeMarkList = () =>
  request({
    url: '/admin/product/baseTrademark/getTrademarkList',
    method: 'get'
  })

// 获取售卖属性列表
export const getAttrList = () =>
  request({ url: '/admin/product/baseSaleAttrList', method: 'get' })

//获取spu信息
export const getSpuInfo = (spuId) =>
  request({ url: `/admin/product/getSpuById/${spuId}`, method: 'get' })

// 删除spu
export const delSpu = (spuId) =>
  request({ url: `/admin/product/deleteSpu/${spuId}`, method: 'DELETE' })
